package cn.dust.design.pattern.creational.prototype;

/**
 * @Author: dust
 * @Date: 2019/11/26 16:56
 */
public class Test {
    public static void main(String[] args) throws CloneNotSupportedException {
        Mail mail=new Mail();
        mail.setContent("初始化模板");
        for(int i=0;i<10;i++){

            Mail mailTemp= (Mail) mail.clone();

            mailTemp.setName("姓名"+i);
            mailTemp.setEmailAddress("姓名"+i+"@qq.com");
            mailTemp.setContent("恭喜中奖");
            MailUtil.sendMail(mailTemp);
        }

        MailUtil.saveOriginMailRecord(mail);
    }
}
